<template>
    <div>
        <Modal v-model="modal.search" title="高级搜索" width="1020">
            <Form ref="searchForm" :model="searchForm" :label-width="120">
                <Row>
	<i-col span="12">
	<FormItem label="作业编号"><Row>
	<i-col span="11">
	<FormItem prop="idMin">
	<InputNumber v-model="searchForm.idMin" placeholder="请输入开始作业编号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="idMax">
	<InputNumber v-model="searchForm.idMax" placeholder="请输入结束作业编号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="作业名称" prop="name">
	<Input v-model="searchForm.name" placeholder="请输入作业名称" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="完整类名" prop="className">
	<Input v-model="searchForm.className" placeholder="请输入完整类名" clearable/>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="cron表达式" prop="cronExpression">
	<Input v-model="searchForm.cronExpression" placeholder="请输入cron表达式" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="作业组名称" prop="groupName">
	<Input v-model="searchForm.groupName" placeholder="请输入作业组名称" clearable/>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="触发器名称" prop="triggerName">
	<Input v-model="searchForm.triggerName" placeholder="请输入触发器名称" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="触发器组" prop="triggerGroup">
	<Input v-model="searchForm.triggerGroup" placeholder="请输入触发器组" clearable/>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="作业描述" prop="description">
	<Input v-model="searchForm.description" placeholder="请输入作业描述" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="作业状态"><Row>
	<i-col span="11">
	<FormItem prop="jobStatusMin">
	<InputNumber v-model="searchForm.jobStatusMin" placeholder="请输入开始作业状态" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="jobStatusMax">
	<InputNumber v-model="searchForm.jobStatusMax" placeholder="请输入结束作业状态" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="状态更新时间"><Row>
	<i-col span="11">
	<FormItem prop="jobStatusTimeMin">
	<DatePicker @on-change="searchForm.jobStatusTimeMin=$event" :value="searchForm.jobStatusTimeMin" placeholder="请输入开始状态更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="jobStatusTimeMax">
	<DatePicker @on-change="searchForm.jobStatusTimeMax=$event" :value="searchForm.jobStatusTimeMax" placeholder="请输入结束状态更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="自动启动" prop="autoStart">
	    
	        <Select v-model="searchForm.autoStart" placeholder="自动启动" filterable clearable>
	          <Option
	            v-for="(option, index) in autoStartSelect"
	            :value="option.value"
	            :key="index"
	          >{{option.displayValue}}</Option>
	        </Select>
	    
	</FormItem>
</i-col><i-col span="12">
	<FormItem label="版本号"><Row>
	<i-col span="11">
	<FormItem prop="versionMin">
	<InputNumber v-model="searchForm.versionMin" placeholder="请输入开始版本号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="versionMax">
	<InputNumber v-model="searchForm.versionMax" placeholder="请输入结束版本号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="创建时间"><Row>
	<i-col span="11">
	<FormItem prop="createTimeMin">
	<DatePicker @on-change="searchForm.createTimeMin=$event" :value="searchForm.createTimeMin" placeholder="请输入开始创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="createTimeMax">
	<DatePicker @on-change="searchForm.createTimeMax=$event" :value="searchForm.createTimeMax" placeholder="请输入结束创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="更新时间"><Row>
	<i-col span="11">
	<FormItem prop="updateTimeMin">
	<DatePicker @on-change="searchForm.updateTimeMin=$event" :value="searchForm.updateTimeMin" placeholder="请输入开始更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="updateTimeMax">
	<DatePicker @on-change="searchForm.updateTimeMax=$event" :value="searchForm.updateTimeMax" placeholder="请输入结束更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="是否激活" prop="isActive">
	    
	        <Select v-model="searchForm.isActive" placeholder="是否激活" filterable clearable>
	          <Option
	            v-for="(option, index) in isActiveSelect"
	            :value="option.value"
	            :key="index"
	          >{{option.displayValue}}</Option>
	        </Select>
	    
	</FormItem>
</i-col>
</Row>

            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="resetForm">清空</Button>
                <Button type="text" size="large" @click="cancelModal">取消</Button>
                <Button type="primary" size="large" @click="searchOkModal" :loading="loading.search">查询</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
	import * as utils from '@/api/utils-v2'
	import * as ResponseStatus from '@/api/response-status'
    export default {
        name: 'SchedulerSearch',
        data() {
            return {
                modal: {
                    search: false
                },
                loading: {
                    search: false
                },
                urls: {
                    searchUrl: '/scheduler/admin/pager-cond'
                },
				dataDictCodes: ['JOB_AUTO_START','IS_ACTIVE'],
				dataDictItems: {},
				isActiveSelect:[],
				autoStartSelect:[],
                searchForm: {
                    pageNo: 1,
                    pageSize: 10,
                    sortColumn: null,
                    sortOrder: null,
                    id: null,
idMin: null, 
idMax: null, 
name: null,
className: null,
cronExpression: null,
groupName: null,
triggerName: null,
triggerGroup: null,
description: null,
jobStatus: null,
jobStatusMin: null, 
jobStatusMax: null, 
jobStatusTime: null,
jobStatusTimeMin: null, 
jobStatusTimeMax: null, 
autoStart: null,
autoStartMin: null, 
autoStartMax: null, 
version: null,
versionMin: null, 
versionMax: null, 
createTime: null,
createTimeMin: null, 
createTimeMax: null, 
updateTime: null,
updateTimeMin: null, 
updateTimeMax: null, 
isActive: null,
isActiveMin: null, 
isActiveMax: null, 

                }
            }
        },
        computed: {},
        mounted() {
			            utils.getDataDict(this.dataDictCodes).then(response => {
			              if (response) {
			                this.dataDictItems = response
			                utils.getSelectDictItems(this, 'IS_ACTIVE', 'isActive', 'isActiveSelect')
							utils.getSelectDictItems(this, 'JOB_AUTO_START', 'autoStart', 'autoStartSelect')
			              }
			            }).catch(error => {
			              console.log(error)
			            })
		},
        methods: {
            resetForm() {
                this.$refs.searchForm.resetFields()
            },
            cancelModal(modal) {
                this.modal.search = false
            },
            searchOkModal(modal) {
                this.modal.search = false
                this.$emit('searchTable', true)
            }
        }
    }
</script>

<style>
</style>
